/**
 * @param {number} lowLimit
 * @param {number} highLimit
 * @return {number}
 */
var countBalls = function (lowLimit, highLimit) {
  let list = new Array(46).fill(0)
  for (let i = lowLimit; i <= highLimit; i++) {
    list[count(i)]++
    
  }
  function count(num) {
    let sum = 0
    while (num) {
      sum += num % 10
      num = Math.floor(num / 10)
    }
    return sum
  }
  let max = 0
  for (let i = 1; i < 46; i++) {
    max = Math.max(list[i],max)
  }
  return max
};
var lowLimit = 5,
  highLimit = 15
console.log(countBalls(lowLimit, highLimit))
